<style>
.flex {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}
.flex.column{
    flex-direction: column;
    -webkit-flex-direction: column;
  justify-content: space-around;
}
    .live-menu-ul{position: relative;}
    .live-menu-ul li{position: relative;float:left;padding:0 8px 0 0;}
    .live-menu-ul li a{width:100px;height:35px;color:#3f3f3f;background: #fff;display: block;text-align: center;line-height: 33px;font-size:14px;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;border:1px solid #ddd;}
    .live-menu-ul li a.add{background: #44abf7  ;color:#fff;border:none;line-height: 35px;}
    .live-menu-ul li.active a{background: #fff;border:1px solid #44abf7  ;}
    .live-menu-ul li span{position: absolute;right:7px;top:12px;background: #ff0000;-webkit-border-radius: 16px;border-radius: 16px;width:16px;height:16px;display: inline-block;line-height: 14px;color:#fff;font-weight:normal;display: none;}
    .live-menu-ul li span i.fa-close:before{font-weight: normal;margin:0 0 0 1px;}

    .live-munu-tab{border:1px solid #efefef;}
    .live-menu-tab-title{height:42px;border-bottom:1px solid #efefef;color:#3f3f3f;background: #f5f5f6;padding:0 20px;line-height: 42px;}
    .live-menu-tab-info{padding:20px;}
    .live-menu-info{display: none;}
    .dd-handle{margin:0;padding:0;}

    .diy-phone{float: left;width: 328px;height: auto;border: 1px solid #ddd;border-radius: 10px;background: #fff;padding: 10px;overflow: hidden;margin-bottom: 50px;}
    .diy-phone .phone-head{height: 44px;background: #fff;position: relative;}
    .diy-phone .phone-head:before{content: "";position: absolute;top: 15px;left: 112px;height: 8px;width: 8px;background: #ddd;border-radius: 8px;}
    .diy-phone .phone-head:after{content: "";position: absolute;top: 15px;left: 128px;height: 8px;width: 50px;background: #ddd;border-radius: 8px;}
    .diy-phone .phone-title{height: 53px;background: url("../addons/jy_weishoplive/resource/images/wx-top.png") 0 0 no-repeat;background-size: 100% auto;padding: 0 50px;font-size: 15px;color: #fff;text-align: center;line-height: 68px;cursor: default;overflow: hidden;display:block;white-space:nowrap;text-overflow:ellipsis;}
    .diy-phone .phone-main{background: #f5f5f5;min-height: 400px;border: 1px solid #ddd;border-top: 0;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
    .diy-phone .phone-main p{margin: 0;padding: 0;}
    .diy-phone .phone-main .highlight{height: 50px;border: 1.5px dashed #999;text-align: center;font-size: 12px;color: #999;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
    .diy-phone .phone-main .drag{position: relative;min-height: 20px;display: block;overflow: hidden;}
    .diy-phone .phone-main .drag.selected:before,
    .diy-phone .phone-main .drag:hover:before{content: "";position: absolute;top: 0;left: 0;right: 0;bottom: 0;border: 2px dashed #00a0e9;cursor: move;z-index: 10;}
    .diy-phone .phone-main .drag.fixed:before{cursor: default;}
    .diy-phone .phone-main .drag .btn-edit-del{height: 16px;position: absolute;right: 2px;bottom: 2px;display: none;}
    .diy-phone .phone-main .drag .btn-edit-del > div{width: 32px;height: 16px;line-height: 16px;display: inline-block;text-align: center;font-size: 10px;color: #fff;background: rgba(0,0,0,.4);margin-left: 2px;cursor: pointer;position: relative;z-index: 11;}
    .diy-phone .phone-main .drag.selected .btn-edit-del ,
    .diy-phone .phone-main .drag:hover .btn-edit-del{display: block;}
    .diy-phone .phone-main .drag.nodelete .btn-edit-del .btn-del{display: none;}
    .diy-phone .phone-main a{color: #337ab7;}
    .diy-phone .phone-foot{height: 24px;width: 60px;margin: 15px auto 5px;border: 1px solid #ddd;border-radius: 5px;}
    .diy-editor{float: left; width: 500px; height: auto; background: #fdfdfd; padding: 15px 10px; margin-left: 18px; border: 1px solid #ddd; border-radius: 5px;margin-bottom: 20px;position: relative;}
    .diy-top-menu{float: left; width: 500px; height: auto; background: #fdfdfd; padding: 10px 10px; margin-left: 18px; border: 1px solid #ddd; border-radius: 5px;margin-bottom: 10px;position: relative;margin-top:190px;}
    .diy-editor .editor-arrow{height: 0; position: relative;}
    .diy-editor .editor-arrow:after,.diy-editor .editor-arrow:before{position: absolute; font-family: simsun; content: "◆"; top: 8px; left: -21px; display: block; width: 9px; height: 18px; font-size: 24px; color: #fdfdfd; z-index: 111;}
    .diy-editor .editor-arrow:after {left: -22px;color: #ddd;z-index: 11;}
    .diy-editor .form-group{margin: 5px 0;}
    .diy-editor .form-group .control-label{padding: 5px 0; text-align: right;}
    .diy-editor .form-group .form-control{padding: 0 5px;}
    .block-tab{height: 40px; background: #fff; display: -webkit-flex; display: -ms-flexbox; display: flex; z-index: 10;border-bottom:1px solid #eaeaea;}
    .player-fullscreen .block-tab{top: 13.5rem;}
    .diy-phone .phone-main .block-tab a{width: 100%; line-height: 40px; text-align: center; font-size: 0.7rem; color: #333; -webkit-box-flex: 1; -webkit-flex: 1; -ms-flex: 1; flex: 1; overflow: hidden;position: relative;}
    .diy-phone .phone-main .block-tab a.active{color: #118cff;}
    .block-tab a.active:before{content: ''; position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0; border-bottom: 2px solid #118cff;}
    .nestable-list span{position: absolute;right:1px;top:-1px;height:9px;line-height: 9px;font-size:14px;font-weight: normal;}
</style>
<div class="alert alert-primary">
    <p>说明:</p>
    <p>1. 默认选项卡为【直播间】、【商品】、【介绍】，不可删除。名称可以自定义，如不填写则显示默认名称。</p>
    <p>2. 最多只能显示5个菜单，在【商品】，【介绍】不显示的情况下，可以添加四个自定义菜单</p>
</div>
<div class="col-jy" style="width:100%;margin-left:0;margin-right: 0;">
    <div class="diy-phone">
        <div class="phone-head"></div>
        <div class="phone-body">
            <div class="phone-main" id="phone">
                <div class="phone-title">互动直播</div>
                <div>
                    <img src="../addons/jy_weishoplive/resource/images/room/live-video.png" width="100%" alt="">
                </div>
                <div>
                    <div class="block-tab" id="sortable">
                        <a ng-repeat="row in pagedata.item.nestable" href="javascript:void(0);" ng-click="pagedata.settab($index);" ng-if="pagedata.item.menu[row].noshow!=1" ng-class="{'nestable-list':1,'active':pagedata.tabindex==$index}">
                            <input type="hidden" value="{{row}}">
							<div ng-if="!pagedata.item.menu[row].name">
							 <div ng-if="row=='interaction'">直播间</div>
							 <div ng-if="row=='goods'">商品</div>
							 <div ng-if="row!='interaction' && row!='goods'">介绍</div>
							</div>
                            <div ng-if="pagedata.item.menu[row].name">
                            {{pagedata.item.menu[row].name}}
							</div>
							<span ng-if="row!='interaction' && row!='goods' && row!='introduce'">
								<span ng-click="pagedata.item.nestable.splice($index,1)"><i class="fa fa-close"></i></span>
							</span>
                        </a>
                    </div>
                </div>
                <div class="content">
                    <img src="../addons/jy_weishoplive/resource/images/room/interaction.png" width="100%" alt="">
                </div>
                <div class="phone-footer">
                    <img src="../addons/jy_weishoplive/resource/images/room/footer.png" width="100%" alt="">
                </div>
            </div>
        </div>
        <div class="phone-foot"></div>
    </div>
    <div class="flex column">
        <div class="diy-top-menu">
            <ul class="live-menu-ul">
                <li><a href="javascript:void(0);" ng-click="pagedata.item.menuadd()" class="add menu-add"><i class="fa fa-plus"></i> 添加菜单</a></li>
                <li ng-if="pagedata.item.menu.goods.noshow"><a href="javascript:void(0);" ng-click="pagedata.tabindex=1" class="nestable-list goods">商品</a></li>
                <li ng-if="pagedata.item.menu.introduce.noshow"><a href="javascript:void(0);" ng-click="pagedata.tabindex=2" class="nestable-list introduce">介绍</a></li>
            </ul>
        </div>
        <div class="diy-editor">
            <div class="editor-arrow"></div>
            <div class="diy-editor-group" id="editor">
                <!--互动start-->
                <div class="inner live-menu-interaction" ng-if="pagedata.item.nestable[pagedata.tabindex]=='interaction'">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">名称</div>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" ng-model="pagedata.item.menu.interaction.name" class="live-name form-control"/>
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.interaction.name||'直播间'}}</div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--互动end-->
                <!--商品satart-->
                <div class="inner live-menu-goods" ng-if="pagedata.item.nestable[pagedata.tabindex]=='goods'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" ng-model="pagedata.item.menu.goods.name" class="live-name form-control"/>
                                <div ng-if="pagedata.roomedit" class="input-group-addon">
                                    <input type="checkbox" ng-model="pagedata.item.menu.goods.noshow" ng-checked="pagedata.item.menu.goods.noshow" class=""> 关闭
                                </div>
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.goods.name||'商品'}}</div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--商品end-->
                <!--直播间介绍start-->
                <div class="inner live-menu-introduce" ng-if="pagedata.item.nestable[pagedata.tabindex]=='introduce'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" ng-model="pagedata.item.menu.introduce.name" class="live-name form-control"/>
                                <div ng-if="pagedata.roomedit" class="input-group-addon">
                                    <input type="checkbox" ng-model="pagedata.item.menu.introduce.noshow" ng-checked="pagedata.item.menu.introduce.noshow" class=""> 关闭
                                </div>
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.introduce.name||'介绍'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">介绍</label>
                        <div class="col-sm-10 col-xs-12" style="padding-top:10px">
                            <textarea ng-if="pagedata.roomedit" style="height:300px;" type="text/plain" id="ueditor-desc" class="form-control ueditor"  ng-model="pagedata.item.content" cols="40"></textarea>
                            <a ng-if="!pagedata.roomedit" class="btn btn-default">查看内容</a>
                        </div>
                    </div>
                </div>
                <!--直播间介绍end-->
                <!--自定义菜单1start-->
                <div class="inner live-menu-customname1" ng-if="pagedata.item.nestable[pagedata.tabindex]=='customname1'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" name="dtab[customname1]" class="live-name form-control" ng-model="pagedata.item.menu.customname1.name"  />
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.customname1.name ||'自定义'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-10"  style="height:30px">
                            <div class="input-group input-group-sm">
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" ng-model="pagedata.item.menu.customname1.type" value="0" ng-checked="pagedata.item.menu.customname1.type!=1"/> 文本</label>
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" ng-model="pagedata.item.menu.customname1.type" value="1" ng-checked="pagedata.item.menu.customname1.type==1"/> 链接</label>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname1.type==1?'链接':'文本'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="pagedata.item.menu.customname1.type==1">
                        <label class="col-sm-2 control-label">链接</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" class="form-control input-sm diy-bind" placeholder="请选择链接或输入链接地址" ng-model="pagedata.item.menu.customname1.url" id="shareurl" />
                                <span ng-if="pagedata.roomedit" ng-click="choose_link(pagedata.item.menu.customname1,'url','action')" class="input-group-addon btn btn-default">选择链接</span>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname1.url}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="pagedata.item.menu.customname1.type!=1">
                        <label class="col-sm-2 control-label">内容</label>
                        <div class="col-sm-10 col-xs-12" style="padding-top:10px">
							<textarea style="height:300px;" type="text/plain" id="ueditor-customname1" class="form-control ueditor"  ng-model="pagedata.item.menu.customname1.content" cols="40"></textarea>
                        </div>
                    </div>
                </div>
                <!--自定义菜单1end-->
                <!--自定义菜单2start-->
                <div class="inner live-menu-customname2" ng-if="pagedata.item.nestable[pagedata.tabindex]=='customname2'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" class="live-name form-control" ng-model="pagedata.item.menu.customname2.name||'自定义'"  />
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.customname2.name||'自定义'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-10" style="height:30px">
                            <div class="input-group input-group-sm">
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" ng-model="pagedata.item.menu.customname2.type" value="0" ng-checked="pagedata.item.menu.customname2.type!=1" /> 文本</label>
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" ng-model="pagedata.item.menu.customname2.type" value="1" ng-checked="pagedata.item.menu.customname2.type==1"/> 链接</label>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname2.type==1?'链接':'文本'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname2-type-url" ng-if="pagedata.item.menu.customname2.type==1">
                        <label class="col-sm-2 control-label">链接</label>
                        <div class="col-sm-10 col-xs-12">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" class="form-control input-sm diy-bind" placeholder="请选择链接或输入链接地址" ng-model="pagedata.item.menu.customname3.url" id="shareurl2" />
                                <span ng-if="pagedata.roomedit" ng-click="choose_link(pagedata.item.menu.customname2,'url','action')" class="input-group-addon btn btn-default">选择链接</span>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname2.url}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname2-type-content" ng-if="pagedata.item.menu.customname2.type!=1">
                        <label class="col-sm-2 control-label">内容</label>
                        <div class="col-sm-10 col-xs-12" style="padding-top:10px">
							<textarea style="height:300px;" type="text/plain" id="ueditor-customname2" class="form-control ueditor"  ng-model="pagedata.item.menu.customname2.content" cols="40"></textarea>
                        </div>
                    </div>
                </div>
                <!--自定义菜单2end-->
                <!--自定义菜单3start-->
                <div class="inner live-menu-customname3" ng-if="pagedata.item.nestable[pagedata.tabindex]=='customname3'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" name="dtab[customname3]" data-tab="customname3" class="live-name form-control" value="{{pagedata.item.menu.customname3.name||'自定义'}}"  />
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.customname3.name||'自定义'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" name='dtab[customtype3]' data-tab="customname3" value="0" ng-checked="pagedata.item.menu.customname3.type!=1"/> 文本</label>
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" name='dtab[customtype3]' data-tab="customname3" value="1" ng-checked="pagedata.item.menu.customname3.type==1"/> 链接</label>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname3.type==1?'链接':'文本'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname3-type-url" ng-if="pagedata.item.menu.customname3.type==1">
                        <label class="col-sm-2 control-label" style="height:20px">链接</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" name="dtab[customurl3]" class="form-control input-sm diy-bind" placeholder="请选择链接或输入链接地址" value="{{pagedata.item.menu.customname3.url}}" id="shareurl3" />
                                <span ng-if="pagedata.roomedit" data-input="#shareurl3" data-toggle="selectUrl" data-full="true" class="input-group-addon btn btn-default">选择链接</span>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname3.url}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname3-type-content" ng-if="pagedata.item.menu.customname3.type!=1">
                        <label class="col-sm-2 control-label">内容</label>
                        <div ng-if="pagedata.roomedit" class="col-sm-10 col-xs-12">
                        </div>
                    </div>
                </div>
                <!--自定义菜单3end-->
                <!--自定义菜单4start-->
                <div class="inner live-menu-customname4" ng-if="pagedata.item.nestable[pagedata.tabindex]=='customname4'">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" name="dtab[customname4]" data-tab="customname4" class="live-name form-control" value="{{pagedata.item.menu.customname4.name||'自定义'}}"  />
                                <div ng-if="!pagedata.roomedit" class="form-control valid">{{pagedata.item.menu.customname4.name||'自定义'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" name='dtab[customtype4]' data-tab="customname4" value="0" ng-checked="pagedata.item.menu.customname4.type!=1" /> 文本</label>
                                <label ng-if="pagedata.roomedit" class="radio-inline"><input type="radio" class="customname" name='dtab[customtype4]' data-tab="customname4" value="1" ng-checked="pagedata.item.menu.customname4.type!=1" /> 链接</label>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname4.type==1?'链接':'文本'}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname4-type-url" ng-if="pagedata.item.menu.customname4.type==1">
                        <label class="col-sm-2 control-label">链接</label>
                        <div class="col-sm-10">
                            <div class="input-group input-group-sm">
                                <input ng-if="pagedata.roomedit" type="text" name="dtab[customurl4]" class="form-control input-sm diy-bind" placeholder="请选择链接或输入链接地址" value="{{pagedata.item.menu.customname4.url}}" id="shareurl4" />
                                <span ng-if="pagedata.roomedit" data-input="#shareurl4" data-toggle="selectUrl" data-full="true" class="input-group-addon btn btn-default">选择链接</span>
                                <div ng-if="!pagedata.roomedit" class='form-control-static'>{{pagedata.item.menu.customname4.url}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group customname4-type-content" ng-if="pagedata.item.menu.customname4.type!=1">
                        <label class="col-sm-2 control-label">内容</label>
                        <div ng-if="pagedata.roomedit" class="col-sm-10 col-xs-12">
                        </div>
                    </div>
                </div>
                <!--自定义菜单4end-->
            </div>
        </div>
    </div>
</div>
<div>
	<button class="btn btn-primary" ng-click="post(pagedata.item,'post')">提交</button>
	<button class="btn btn-gray" ng-click="access_json('room/')">返回列表</button>
</div>
<script type="text/javascript">
//初始化百度编辑器  
scope.pagedata.desc=function(){      
        var pagestate = 0;
		UE.delEditor('ueditor-desc');
		var ue_content = UE.getEditor("ueditor-desc", {
            topOffset: 0,
            autoFloatEnabled: false,
            autoHeightEnabled: false,
            autotypeset: {
                removeEmptyline: true
            },
            maximumWords : 9999999999999,
            initialFrameHeight: 607,
            focus : false,
            toolbars : [['fullscreen', 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', '|','justifyleft', 'justifycenter', 'justifyright', '|', 'insertorderedlist', 'insertunorderedlist', 'blockquote', 'emotion', 'removeformat', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight','indent', 'paragraph', 'fontsize', '|','inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol','mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|', 'anchor', 'map', 'print', 'drafts', '|','autotypeset','insertcode','myinsertvideo','preview']],
        });
		ue_content.ready(function() {
            if(window.scope.pagedata.item.content && window.scope.pagedata.item.content!=null){
				//alert(window.scope.pagedata.item.content);
				ue_content.setContent(window.scope.pagedata.item.content);
			}
			ue_content.addListener('contentChange',function(){
                window.current_ue=ue_content;
				window.scope.pagedata.item.content=ue_content.getContent();
                pagestate = 1;
            });
			
        });
}
</script>
<script type="text/javascript">
//初始化百度编辑器       
scope.pagedata.customname1=function(){ 
        var pagestate = 0;
		UE.delEditor('ueditor-customname1');
		var ue_customname1 = UE.getEditor("ueditor-customname1", {
            topOffset: 0,
            autoFloatEnabled: false,
            autoHeightEnabled: false,
            autotypeset: {
                removeEmptyline: true
            },
            maximumWords : 9999999999999,
            initialFrameHeight: 607,
            focus : false,
            toolbars : [['fullscreen', 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', '|','justifyleft', 'justifycenter', 'justifyright', '|', 'insertorderedlist', 'insertunorderedlist', 'blockquote', 'emotion', 'removeformat', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight','indent', 'paragraph', 'fontsize', '|','inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol','mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|', 'anchor', 'map', 'print', 'drafts', '|','autotypeset','insertcode','myinsertvideo','preview']],
        });
		scope.pagedata.item.menu.customname1=scope.pagedata.item.menu.customname1?scope.pagedata.item.menu.customname1:{}
		ue_customname1.ready(function() {
            if(window.scope.pagedata.item.menu.customname1.content && window.scope.pagedata.item.menu.customname1.content!=null){
				//alert(window.scope.pagedata.item.content);
				ue_customname1.setContent(window.scope.pagedata.item.menu.customname1.content);
			}
			ue_customname1.addListener('contentChange',function(){
                window.current_ue=ue_customname1;
				window.scope.pagedata.item.menu.customname1.content=ue_customname1.getContent();
                pagestate = 1;
            });
			
        });
}
</script>
<script type="text/javascript">
//初始化百度编辑器
scope.pagedata.customname2=function(){   
        var pagestate = 0;
		UE.delEditor('ueditor-customname2');
		var ue_customname2 = UE.getEditor("ueditor-customname2", {
            topOffset: 0,
            autoFloatEnabled: false,
            autoHeightEnabled: false,
            autotypeset: {
                removeEmptyline: true
            },
            maximumWords : 9999999999999,
            initialFrameHeight: 607,
            focus : false,
            toolbars : [['fullscreen', 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', '|','justifyleft', 'justifycenter', 'justifyright', '|', 'insertorderedlist', 'insertunorderedlist', 'blockquote', 'emotion', 'removeformat', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight','indent', 'paragraph', 'fontsize', '|','inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol','mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|', 'anchor', 'map', 'print', 'drafts', '|','autotypeset','insertcode','myinsertvideo','preview']],
        });
		scope.pagedata.item.menu.customname2=scope.pagedata.item.menu.customname2?scope.pagedata.item.menu.customname2:{}
		ue_customname2.ready(function() {
            if(window.scope.pagedata.item.menu.customname2.content && window.scope.pagedata.item.menu.customname2.content!=null){
				//alert(window.scope.pagedata.item.content);
				ue_customname2.setContent(window.scope.pagedata.item.menu.customname2.content);
			}
			ue_customname2.addListener('contentChange',function(){
                window.current_ue=ue_customname2;
				window.scope.pagedata.item.menu.customname2.content=ue_customname2.getContent();
                pagestate = 1;
            });
			
        });
}
</script>
<script type="text/javascript">
scope.pagedata.tabindex=0;
scope.pagedata.roomedit=true;
scope.pagedata.settab=function (index) {
	scope.pagedata.tabindex=index;
	if(scope.pagedata.tabindex==2){
		scope.pagedata.desc()
	}
	if(scope.pagedata.tabindex==3){
		scope.pagedata.customname1()
	}
	if(scope.pagedata.tabindex==4){
		scope.pagedata.customname2()
	}
}
scope.pagedata.item.menuadd=function () {
       var id = scope.pagedata.item.id;
       var total = scope.pagedata.item.nestable.length
       if(total>=5){
          scope.message('最多使用5个菜单!');
          return;
       }
	   var data=scope.pagedata.menus[total];
	  scope.pagedata.item.nestable.push(data);
	  scope.pagedata.tabindex=total;
	  if(scope.pagedata.tabindex==3){
			scope.pagedata.customname1()
	  }
	  if(scope.pagedata.tabindex==4){
			scope.pagedata.customname2()
	  }
	  scope.$evalAsync();
}
</script>